<#escape x as (x)!> <#include "basewithsidebar.ftl"/> <#macro title> ${config.blogTitle}-修改文章 </#macro> <#macro scripts>
<script type="text/javascript" src="/scripts/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/scripts/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.autobox/jquery.templating.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.autobox/jquery.ui.autobox.ext.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.autobox/jquery.ui.autobox.js"></script>
<link rel="stylesheet" href="/scripts/jquery.ui.autobox/jquery.ui.autobox.css" type="text/css" media="screen" />

<script type="text/javascript">
	window.onload = function()
	{
		CKEDITOR.replace( 'content' );
	}
</script>

<script type="text/javascript">
    if(!window.console){
      console = typeof(console) !== 'undefined' ? console : { log: function(msg) { $('#log').html(msg + '<br/>\n' + $('#log').html() ); } };
    }
    $(function() {
      var list1 = [
      <#if taglist?exists><#list taglist as tag>{text: '${tag.name}'},</#list></#if>];
      var box =
      $("input.autobox.1").autobox({
        list: list1,
        match: function(typed) {
          this.typed = typed;
          this.pre_match = this.text;
          this.match = this.post_match = '';
          if (!this.ajax && !typed || typed.length == 0) { return true; }
          var match_at = this.text.search(new RegExp("\\b" + typed, "i"));
          if (match_at != -1) {
            this.pre_match = this.text.slice(0,match_at);
            this.match = this.text.slice(match_at,match_at + typed.length);
            this.post_match = this.text.slice(match_at + typed.length);
            return true;
          }
          return false;
        },
        insertText: function(obj) { return obj.text },
        templateText: "<li><%= pre_match %><span class='matching' ><%= match %></span><%= post_match %></li>",
        prevals : [ <#if post.tags?exists><#list post.tags as tag>'${tag}'<#if tag_has_next>,</#if></#list></#if> ],
      });
      $("input.autobox")
        .bind("activate.autobox", function(e, d) { console.log(d); })
        .bind("cancel.autobox", function(e) { console.log("Cancelled"); });
    });
</script>
</#macro> <#macro main>
<form id="editpost" method="post">
	<input type=hidden name=action id=action value="edit" />
	<div style="font-size: 16px; margin-bottom: 5px;">
		标题:
		<input name="title" id="title" maxlength="100" style="width: 80%; height: 16px;" value="${post.title}" />
	</div>
	<div style="font-size: 16px;">
		<span style="float: left;">标签：</span>
		<input type="text" class="autobox 1" name="tags" />
	</div>
	<textarea name="content" id="content" style="width: 80%; height: 800px;">${post.content}</textarea>
	<br />
	<div style="" id="option">
		日期：
		<input name="pubdate" id="pubdate" type=text size=16 value="${post.date?datetime}" />
		<img align="absmiddle" onclick="WdatePicker({el:'pubdate',dateFmt:'yyyy-MM-dd HH:mm'})" style="cursor: pointer;" src="/scripts/My97DatePicker/skin/datePicker.gif" />
		权限：
		<input type=radio name=privilege value=1
		<#if post.privilege = 1>checked</#if>/>公开
		<input type=radio name=privilege value=0
		<#if post.privilege = 0>checked</#if>/>私有
		<input type=radio name=privilege value=2
		<#if post.privilege = 2>checked</#if>/>Spin
	</div>
	<input type="submit" value="提交" />
</form>
</#macro> </#escape>
